
#import "GetLoginFormRequest.h"
#import "PostLoginRequest.h"
#import "GetUserDetailsRequest.h"
#import "GetUserPassKeyRequest.h"
#import "GetTorrentListRequest.h"
#import "GetUserTorrentListRequest.h"
#import "GetTorrentFileListRequest.h"
#import "GetTorrentPeerListRequest.h"
#import "GetTorrentDetailsRequest.h"
#import "TorrentMagicRequest.h"
#import "KarmaShopRequest.h"

//
// nexus client
//
@interface NexusClient : NSObject

//
// nexus php
//
@property(strong, nonatomic, readwrite) NSString*							cookieNexusPhp;

//
// domain
//
@property(strong, nonatomic, readwrite) NSString*							domain;

//
// protocol
//
@property(strong, nonatomic, readwrite) NSString*							protocol;

//
// singleton
//
+ (NexusClient*)sharedClient;

//
// parse free type
//
+ (NSString*)parseFreeTypeForImgClass:(NSString*)imgClass;

//
// parse free type
//
+ (NSString*)parseFreeTypeForFontClass:(NSString*)fontClass;

//
// parse free type
//
+ (NSString*)parseFreeTypeForRowClass:(NSString*)rowClass;

//
// base url
//
- (NSString*)baseURLString;

//
// torrent download link
//
- (NSString*)torrentDownloadAddress:(TorrentInfo*)torrentInfo passKey:(NSString*)passKey httpsMode:(BOOL)httpsMode;

//
// get login form
//
- (void)getLoginFormWithCallback:(AsyncHttpRequestFinishCallback)callback;

//
// get captcha image
//
- (void)getCaptchaImage:(NSString*)address callback:(AsyncHttpRequestFinishCallback)callback;

//
// post login
//
- (void)postLogin:(NSString*)userName password:(NSString*)password captcha:(NSString*)captcha sessionId:(NSString*)sessionId callback:(AsyncHttpRequestFinishCallback)callback;

//
// get user details
//
- (void)getUserDetails:(NSInteger)userId callback:(AsyncHttpRequestFinishCallback)callback;

//
// get user passkey
//
- (void)getUserPassKeyWithCallback:(AsyncHttpRequestFinishCallback)callback;

//
// get torrent list
//
- (void)getTorrentListPage:(NSInteger)pageIndex callback:(AsyncHttpRequestFinishCallback)callback;

//
// get user torrents list
//
- (void)getUserTorrentList:(NSInteger)userId type:(NSString*)type callback:(AsyncHttpRequestFinishCallback)callback;

//
// get file list
//
- (void)getTorrentFileList:(NSInteger)torrentId callback:(AsyncHttpRequestFinishCallback)callback;

//
// get peer list
//
- (void)getTorrentPeerList:(NSInteger)torrentId callback:(AsyncHttpRequestFinishCallback)callback;

//
// get torrent details
//
- (void)getTorrentDetails:(NSInteger)torrentId callback:(AsyncHttpRequestFinishCallback)callback;

//
// search torrent
//
- (void)searchTorrentWithPattern:(NSString*)filterPattern pageIndex:(NSInteger)pageIndex callback:(AsyncHttpRequestFinishCallback)callback;

//
// compute required karma count for magic
//
- (void)getRequiredKarmaForTorrent:(NSInteger)torrentId magicType:(NSInteger)magicType userType:(NSInteger)userType duration:(NSInteger)duration callback:(AsyncHttpRequestFinishCallback)callback;

//
// torrent magic
//
- (void)doMagic:(NSInteger)magicType forTorrent:(NSInteger)torrentId userType:(NSInteger)userType duration:(NSInteger)duration callback:(AsyncHttpRequestFinishCallback)callback;

//
// exchange uCoin -> karma
//
- (void)exchangeUCoinToKarma:(NSInteger)count callback:(AsyncHttpRequestFinishCallback)callback;

@end
